package com.tian.springboot.redis;

import com.tian.springboot.redis.util.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Component;

/**
 * @author tianke
 * @date 2021/2/19 10:15
 */
@SpringBootApplication
public class SpringbootRedisApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootRedisApplication.class, args);
    }

    @Component
    class Runner implements ApplicationRunner{

        @Autowired
        private RedisUtils redisUtils;
        @Override
        public void run(ApplicationArguments args) throws Exception {
            redisUtils.set("value",0);
        }
    }
}
